package com.bbcare.nutritious.plat.store.ibatis;

import java.util.List;
import java.util.Map;

import com.bbcare.nutritious.plat.entity.NtCourseFood;
import com.bbcare.nutritious.plat.entity.NtCourseNutrients;
import com.bbcare.nutritious.plat.entity.NtCoursePeriodtime;
import com.bbcare.nutritious.plat.entity.NtSchemeCourseVersion;
import com.bbcare.nutritious.plat.entity.NtSchemeStage;
import com.bbcare.nutritious.plat.entity.NtSchemeVersion;
import com.bbcare.nutritious.plat.entity.NtStageCourse;
import com.bbcare.nutritious.plat.entity.PtCourseSituation;
import com.bbcare.nutritious.plat.entity.PtFoodFast;
import com.bbcare.nutritious.plat.entity.PtNtcourseFood;
import com.bbcare.nutritious.plat.entity.PtNtcourseNutrients;
import com.bbcare.nutritious.plat.entity.PtNtcoursePeriodtime;
import com.bbcare.nutritious.plat.entity.PtNtschemeCourse;
import com.bbcare.nutritious.plat.entity.PtNtschemeInfo;
import com.bbcare.nutritious.plat.entity.PtNtschemeStage;
import com.bbcare.nutritious.plat.entity.PtNtsituationModifyLog;




/**
 * 
 * @name:         INutritionSchemeDao.java
 * @author:       tao
 * @createTime:   2017年7月3日
 * @description:  
 * @modify:
 *
 */
public interface INutritionSchemeUsedDao {
	//查询使用方案信息 
	List<PtNtschemeInfo> selectPatientSchemeInfo(Map<String,Object> paramMap)throws Exception;
	
	List<PtNtschemeInfo> selectPatientSchemeInfoUsed(Map<String,Object> paramMap)throws Exception;
	//查询方案阶段列表
	List<PtNtschemeStage> selectPatientStageList(Map<String,Object> paramMap)throws Exception;
	
	//查询方案疗程列表
	List<PtNtschemeCourse> selectPatientCourseList(Map<String,Object> paramMap)throws Exception;
		
	//查询时间阶段 食物列表
	List<Map<String,Object>> selectPatientPeriodFoodList(Map<String,Object> paramMap)throws Exception;
	
	//查询时间阶段
	List<Map<String,Object>> selectPatientPeriodList(Map<String,Object> paramMap)throws Exception;
		
	//查询疗程基本信息
	PtNtschemeCourse selectPatientCourseInfo(Map<String,Object> paramMap)throws Exception;
	
	//查询食物饮食情况列表
	List<Map<String,Object>> selectPatientSituationList(Map<String,Object> paramMap)throws Exception;
	
	
	//查询饮食情况列表 按表类
	List<PtCourseSituation> selectPatientSituations(Map<String,Object> paramMap)throws Exception;
	
	//保存患者使用方案信息
  	void savePatientScheme(PtNtschemeInfo ptSchemeInfo) throws Exception;
  	
  	//保存患者方案阶段信息
  	void savePatientStages(List<PtNtschemeStage> stageList) throws Exception;
  	
  	//保存患者疗程信息
  	void savePatientCourse(List<PtNtschemeCourse> schmeCourseList) throws Exception;
  	
  	//保存患者疗程使用情况
  	void savePatientSituation(List<PtCourseSituation> ptCourseSituation) throws Exception;
  	
  	//保存新的患者食用食物
  	void saveNewPatientSituation(List<PtCourseSituation> ptCourseSituation) throws Exception;
  	
  	//保存患者方案食物
  	void savePatientCourseFood(List<PtNtcourseFood> ptCourseFood) throws Exception;
  	
  	//保存患者方案禁用食物列表
  	void savePatientFoodFast(List<PtFoodFast> ptFoodFast) throws Exception;
  	
  	//保存患者疗程时段信息
  	void savePatientPeriod(List<PtNtcoursePeriodtime> ptNtcoursePeriodtime) throws Exception;
  	
  	//保存患者疗程营养标准
  	void savePatientCourseNutrients(List<PtNtcourseNutrients> list) throws Exception;
  	
  	//根据方案id 查询方案信息
  	NtSchemeVersion selectSchemeVersionDetail(Map<String,Object> paramMap)throws Exception;
  	
  	//根据方案版本id 查询方案各阶段信息
  	List<NtSchemeStage> selectSchemeStageList(Map<String,Object> map) throws Exception ;
  	
  	//根据阶段ID查询  阶段疗程信息
  	List<NtStageCourse> selectStageCourseList(Map<String,Object> map) throws Exception ;

  	//根据疗程id 疗程基本信息
  	NtSchemeCourseVersion selectCourseVersionDetail(Map<String,Object> paramMap)throws Exception;

  	//根据疗程查询疗程时间段 
  	List<NtCoursePeriodtime> selectCoursePeriods(Map<String,Object> map) throws Exception ;
 
  	//根据疗程查询疗程下食物列表
  	List<NtCourseFood> selectCourseFoods(Map<String,Object> map) throws Exception ;
  	 
  	//查询疗程营养元素详情
  	List<Map<String,Object>> selectPatientCourseNutrients(Map<String,Object> paramMap) throws Exception;
  	
  	//查询应用疗程食物元素含量列表
  	List<Map<String,Object>> selectPatientFoodNutrients(Map<String,Object> paramMap) throws Exception ;
  	
  	//查询不在计划内的食物所含营养元素,新营养使用2018.7.16
  	List<Map<String,Object>> listNotPlanFoodNutrients(Map<String,Object> paramMap) throws Exception ;
  	
  	//更新疗程开始时间
  	int updateCourseStartDate(Map<String,Object> paramMap) throws Exception ;
  	
  	//更新饮食情况具体时间
  	int updateSituationTimes(List<Map<String,Object>> list) throws Exception ;
  	
  	void updateSituation(Map<String,Object> paramMap) throws Exception ;
  	
  	//更新饮食情况量 修改 
  	int updateSituationAmount(Map<String,Object> paramMap) throws Exception ;
  	
  	//保存饮食情况修改记录
  	int savePtNtsituationLog(List<PtNtsituationModifyLog> list) throws Exception ;
  	
  	//查询饮食情况记录查询
  	List<Map<String,Object>> selectSituationLogs(Map<String,Object> paramMap) throws Exception ;
  	
  	//更新应用方案状态
  	int updatePtSchemeInfo(Map<String,Object> paramMap) throws Exception ;
  	
  	int updatePtSchemeStage(Map<String,Object> paramMap) throws Exception ;
  	//根据阶段 停止之前阶段 所有疗程
  	int updatePtSchemeCourseByStageNo(Map<String,Object> paramMap) throws Exception ;
  	//更新疗程状态
  	int updatePtSchemeCourse(Map<String,Object> paramMap) throws Exception ;
  	
  	//查询患者方案列表
  	List<Map<String,Object>> selectPatientSchemeList(Map<String,Object> paramMap) throws Exception ;
  	
  	int selectSchemeUsedPatientCount(Map<String,Object> paramMap) throws Exception ;
  	
  	int selectPatientSchemeCount(Map<String,Object> paramMap) throws Exception ;
  	
  	 //查询疗程营养元素  (走数据库 方案应用)
  	List<NtCourseNutrients> selectCourseNutrientsPublish(Map<String,Object> map) throws Exception ;
  	
	//查询版本列表
  	List<Map<String,Object>> selectSchemeList(Map<String,Object> map) throws Exception ;
  	
  	//方案总数
  	int selectSchemeCount(Map<String,Object> paramMap);
  	
  	//查询用户当前正在使用的疗程
  	Map<String,Object> selectCurrentCourse(Map<String,Object> map) throws Exception ;
  	
  	PtCourseSituation selectPatientSituationById(Map<String, Object> map)throws Exception;
  	
  	/**
  	 *  查询食物分类
  	 */
  	Map<String,Object> getFoodTypeByFoodId(String foodId) throws Exception ;
  	/**
  	 *  通过分类查询食物列表 
  	 */
  	List<Map<String,Object>> listFoodByType(Map<String,Object> map) throws Exception ;
  	/**
  	 *  通过分类查询食物列表-统计
  	 */
  	int countFoodByType(Map<String,Object> map) throws Exception ;
  	/**
  	 * 查询食物饮食情况列表 加上能量
  	 * @param paramMap
  	 * @return
  	 * @throws Exception
  	 */
  	List<Map<String,Object>> selectPatientSituation(Map<String,Object> paramMap)throws Exception;
  	/**
  	 * 查询上传新食物的参数 
  	 */
  	PtCourseSituation getNewFoodSituationParam(PtCourseSituation pcsParam)throws Exception;
}
